﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//using DrawCurves;

namespace Heavy_Metals
{
    public partial class MXLD_KSLD : Form
    {
        public MXLD_KSLD()
        {
            InitializeComponent();
        }
        public  DrawCurves dc = new DrawCurves();
        private void MXLD_KSLD_Load(object sender, EventArgs e)
        {

        }
        private void MXLD_KSLD_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Pen p = new Pen(Color.Blue, 2);
            dc.DrawCoordinate(g, p, 100, 200, 400, 180, 20, 20, 2.5, 5.0);
            
        }
        private void button4_Click(object sender, EventArgs e)
        {
            //保存文件
            saveFileDialog1.Filter = "rtf files (*.rtf)|*.rtf|Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Graphics g =this.CreateGraphics();
            Pen p = new Pen(Color.Blue, 2);
            MessageBox.Show("率定成功", "操作提示");
            double perPicelY = 5.0 / 20;
            double[] data = { 23, 24, 22, 23, 20, 22, 21, 19, 22, 23, 26, 22, 24 };
            dc.DrawCurve(g, p, "浓度", new Point(10, 10), 100, 200, perPicelY, 20, data);
  
            this.textBox1.Text = "30%";
            this.textBox2.Text = "0.25";
            this.textBox3.Text = "12";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //打开文件
            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter = "rtf files (*.rtf)|*.rtf|Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            openFileDialog1.RestoreDirectory = true;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox8.Text=openFileDialog1.FileName;
            }
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.comboBox2.Text != "二维模型")
            {
                this.textBox5.Enabled = false;
                this.textBox6.Enabled = false;
                this.textBox7.Enabled = false;
            }
            else
            {
                this.textBox7.Enabled = true;
                this.textBox6.Enabled = true;
                this.textBox5.Enabled = true;
            }
        }
        public static int count = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            if (count == 1)
            {
                count = 0;
                this.label7.Text = "下断面：巴彦港";
            }
            if (count == 0)
            {
                count++;
                this.label6.Text = "上段面：朱顺屯";
            }

        }




    }
}
